const Mock = require('mockjs')

let Result = {
  code: 200,
  msg: "操作成功",
  data: null

}

// 获取专题
Mock.mock('/cat/zt/getAllSpecial', 'post', () => {
  Result.data = {
    code: "001",
    special: [{
      "pid": 2,
      "specialName": "当季推荐mock",
      "category_id": 1,
      "special_title": "当季推荐",
      "product_selling_price": 1599,
      "product_num": 10,
      "product_sales": 0
    }]
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取攻略详细信息
Mock.mock('/cat/gl/info', 'post', () => {
  console.log("获取景点详细信息")
  Result.data = {
    code: "001",
    glDetail: {
      title:"避暑山庄：一座皇家园林，半部浩渺清史",
      detail: "\n" +
        "\n" +
        "\n" +
        "\n" +
        "### 构造sdk配置信息表更新 done\n" +
        "\n" +
        "[新增海外配置](https://wiki.inkept.cn/pages/viewpage.action?pageId=215745522)\n" +
        "\n" +
        "[2022-1-26 海外muaah 1v1视频接入](https://wiki.inkept.cn/pages/viewpage.action?pageId=225149914)\n" +
        "\n" +
        "\n" +
        "\n" +
        "美摄库资源申请：仅需要才申请\n" +
        "\n" +
        "线上环境\n" +
        "\n" +
        "```bash\n" +
        "hKp8/FVi0apG30khSKoQYrRax7hb3302bb+0V1oWfQGPMzwB/1UAOmRwXDN7pIQ67xzPp9Xnj4+5kJ+juukBEw/WTKqX+Uz5TL3R2E3SamookMjAiyZocfHwBkPIMBVUlYm/3m3NssJ/D5TTGrKBZwbCETgrT7VxRICMM3kbiAnMkzspakRauqffkSxW3oPDlzDV8Nf96x3qDIlnUDjcMQ==\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "需要进行 md5加密 取小写，中间16位（去掉前后8位）https://www.sojson.com/encrypt_md5.html\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105255.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "af4f101c527aab61\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105506.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "使用这个项目的test 进行部署\n" +
        "\n" +
        "**media.information_cfg**\n" +
        "\n" +
        "**TestUpdateAll**\n" +
        "\n" +
        "```bash\n" +
        "/**\n" +
        "设置更新配置，可以一个或多个\n" +
        " */\n" +
        "func TestUpdateAll(t *testing.T) {\n" +
        "\n" +
        "\t//url := \"http://url.apigateway.inkept.cn/api/comm/sdk_cfg\"\n" +
        "\t//url := \"https://service.inke.cn/api/comm/sdk_cfg\" //国内\n" +
        "\t//url := \"https://10.111.250.168:9213/api/comm/sdk_cfg\" //国内\n" +
        "\turl := \"http://10.226.4.177:9231/api/comm/sdk_cfg\" //新加坡  tx2-inno-media02.sg\n" +
        "\t//url := \"http://10.128.5.241:9231/api/comm/sdk_cfg\" //qa  tx2-inno-media02.sg\n" +
        "\n" +
        "\treqParam := model.RequestParam{\n" +
        "\t\tUid: \"111\",\n" +
        "\t\tCmd: \"update_all\",\n" +
        "\t\tOrigToml: `['com.xdl.muaah']\n" +
        "app_name='muaah'\n" +
        "update_date='1644288638'\n" +
        "zego_audio='80de3e9abcee351d'\n" +
        "zego_video='80de3e9abcee351d'\n" +
        "inke_beauty='af4f101c527aab61'\n" +
        "meishe_license_file=''\n" +
        "`,\n" +
        "\t}\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105704.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "```bash\n" +
        "go test -v server_test.go  server_handle.go server.go -test.run TestUpdateAll\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105639.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "```go\n" +
        "/**\n" +
        "设置更新配置，可以一个或多个\n" +
        " */\n" +
        "func TestUpdateAll(t *testing.T) {\n" +
        "\n" +
        "\t//url := \"http://url.apigateway.inkept.cn/api/comm/sdk_cfg\"\n" +
        "\t//url := \"https://service.inke.cn/api/comm/sdk_cfg\" //国内\n" +
        "\t//url := \"https://10.111.250.168:9213/api/comm/sdk_cfg\" //国内\n" +
        "\turl := \"http://10.226.4.177:9231/api/comm/sdk_cfg\" //新加坡  tx2-inno-media02.sg\n" +
        "\t//url := \"http://10.128.5.241:9231/api/comm/sdk_cfg\" //qa  tx2-inno-media02.sg\n" +
        "\n" +
        "\treqParam := model.RequestParam{\n" +
        "\t\tUid: \"111\",\n" +
        "\t\tCmd: \"update_all\",\n" +
        "\t\tOrigToml: `['inke_beauty_license']\n" +
        "932febe233303ef4='hKp8/FVi0apG30khSKoQYvro9dryE2ZKQPEisOY/60HTDvcAifGPIfyrp445bKiryGczYv05CABfSHK99z/ruYNmZWR6+UoNC8uqKYeIGxfYIokQD1P/jA/UJ+uKDSuA6MsMEEmXUAarg2fl4YrruMMtaEfIBn41LEryM/T8nc3eXrkrzmlMDH0WNsp+NYXlGQ+/cmqHvzN6FZFwjIGIDA=='\n" +
        "af4f101c527aab61='hKp8/FVi0apG30khSKoQYrRax7hb3302bb+0V1oWfQGPMzwB/1UAOmRwXDN7pIQ67xzPp9Xnj4+5kJ+juukBEw/WTKqX+Uz5TL3R2E3SamookMjAiyZocfHwBkPIMBVUlYm/3m3NssJ/D5TTGrKBZwbCETgrT7VxRICMM3kbiAnMkzspakRauqffkSxW3oPDlzDV8Nf96x3qDIlnUDjcMQ=='\n" +
        "`,\n" +
        "\t}\n" +
        "\n" +
        "\tmarshal, _ := json.Marshal(reqParam)\n" +
        "\tpost, err := utils.SentPost(url, marshal)\n" +
        "\tfmt.Printf(\"post:%d, err:%s\", post, err)\n" +
        "}\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105813.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222105832.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "### 长链接回掉事件 done\n" +
        "\n" +
        "<img src=\"https://raw.githubusercontent.com/xzMhehe/StaticFile_CDN/main/static/mo/20220222110054.png\"/>\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "\n" +
        "判断是否设置成功\n" +
        "\n" +
        "项目 **media.agent.usermessage**\n" +
        "\n" +
        "\n" +
        "\n" +
        "```bash\n" +
        "ssh tx2-inno-media02.sg\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "```bash\n" +
        "[maxinze@tx2-inno-media02 ~]$ curl http://localhost:10010/uma/session?appName=muaah\n" +
        "{\"error_code\":0,\"dm_err\":\"success\",\"data\":{\"session\":\"522090\"}}[maxinze@tx2-inno-media02 ~]$\n" +
        "```\n" +
        "\n" +
        "\n" +
        "\n" +
        "正常\n" +
        "\n"
    }
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取景点详细信息
Mock.mock('/cat/goodinfo/info', 'post', () => {
  console.log("获取景点详细信息")
  Result.data = {
    code: "001",
    Product: {
      "pid": 1,
      "goodName": "避暑山庄",
      "category_pid": 1,
      "title": "避暑山庄",
      "des": "承德避暑山庄，又名“承德离宫”或“热河行宫”，是世界文化遗产、国家AAAAA级旅游景区、全国重点文物保护单位、中国四大名园之一。山庄位于河北省承德市中心北部，武烈河西岸一带狭长的谷地上，是清代皇帝夏天避暑和处理政务的场所。避暑山庄分宫殿区、湖泊区、平原区、山峦区四大部分。山庄始建于1703年，1961年被公布为第一批全国重点文物保护单位；1994年列入《世界遗产名录》。",
      "productPicture": [{
        imgUrl: "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/plh.jpg",
        intro: "塞外蟠龙湖"
      }],
      "price": 100,
      "realPrice": 200,
      "product_num": 10,
      "product_sales": 0
    }
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取景点详细信息的图片
Mock.mock('/cat/goodimage/info', 'post', () => {
  Result.data = {
    code: "001",
    goodImage: [{
      imgUrl: "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/detail1.jpg",
      intro: "塞外蟠龙湖"
    }, {
      imgUrl: "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/detail2.jpg",
      intro: "塞外蟠龙湖"
    }, {
      imgUrl: "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/detail3.jpg",
      intro: "塞外蟠龙湖"
    }]
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取全部商品
Mock.mock('/cat/goodinfo/getAllProduct', 'get', () => {
  Result.data = {
    code: "001",
    productList: [{
        "pid": 1,
        "goodName": "蟠龙湖",
        "category_id": 1,
        "product_title": "120Hz流速屏，全速热爱",
        "des": "120Hz高帧率流速屏/ 索尼6400万前后六摄 / 6.67'小孔径全面屏 / 最高可选8GB+256GB大存储 / 高通骁龙730G处理器 / 3D四曲面玻璃机身 / 4500mAh+27W快充 / 多功能NFC",
        "product_picture": "public/imgs/phone/Redmi-k30.png",
        "product_price": 2000,
        "product_selling_price": 1599,
        "product_num": 10,
        "product_sales": 0
      },
      {
        "pid": 2,
        "goodName": "蟠龙湖2",
        "category_id": 1,
        "product_title": "双模5G,120Hz流速屏",
        "des": "双模5G / 三路并发 / 高通骁龙765G / 7nm 5G低功耗处理器 / 120Hz高帧率流速屏 / 6.67'小孔径全面屏 / 索尼6400万前后六摄 / 最高可选8GB+256GB大存储 / 4500mAh+30W快充 / 3D四曲面玻璃机身 / 多功能NFC",
        "product_picture": "public/imgs/phone/Redmi-k30-5G.png",
        "product_price": 2599,
        "product_selling_price": 2599,
        "product_num": 10,
        "product_sales": 0
      },
      {
        "pid": 3,
        "goodName": "蟠龙湖3",
        "category_id": 1,
        "product_title": "1亿像素,五摄四闪",
        "des": "1亿像素主摄 / 全场景五摄像头 / 四闪光灯 / 3200万自拍 / 10 倍混合光学变焦，50倍数字变焦 / 5260mAh ⼤电量 / 标配 30W疾速快充 / ⼩米⾸款超薄屏下指纹 / 德国莱茵低蓝光认证 / 多功能NFC / 红外万能遥控 / 1216超线性扬声器",
        "product_picture": "public/imgs/phone/Mi-CC9.png",
        "product_price": 2799,
        "product_selling_price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 4,
        "goodName": "蟠龙湖4",
        "category_id": 1,
        "product_title": "5000mAh超长续航",
        "des": "5000mAh超长续航 / 高通骁龙439八核处理器 / 4GB+64GB",
        "product_picture": "public/imgs/phone/Redmi-8.png",
        "product_price": 799,
        "product_selling_price": 699,
        "product_num": 20,
        "product_sales": 0
      }
    ],
    totalCount: 20
  }
  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取全部分类
Mock.mock('/cat/goodcatelog/getCategory', 'post', () => {
  Result.data = {
    "code": "001",
    category: [{
        "pid": 1,
        "catelogName": "旅游度假"
      },
      {
        "pid": 2,
        "catelogName": "景点门票"
      },
      {
        "pid": 3,
        "catelogName": "客栈公寓"
      },
      {
        "pid": 4,
        "catelogName": "其他"
      }
    ]
  }
  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取某类产品
Mock.mock('/cat/product/getProductByCategory', 'post', () => {
  Result.data = {
    "code": "001",
    "Product": [{
        "pid": 3,
        "goodName": "蟠龙湖",
        "category_id": 1,
        "product_title": "蟠龙湖",
        "des": "蟠龙湖",
        "product_picture": "public/imgs/phone/Mi-CC9.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 5,
        "goodName": "外八庙",
        "category_id": 1,
        "product_title": "外八庙",
        "des": "外八庙",
        "product_picture": "public/imgs/phone/Redmi-8A.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 6,
        "goodName": "普宁寺",
        "category_id": 1,
        "product_title": "普宁寺",
        "des": "普宁寺",
        "product_picture": "public/imgs/phone/Redmi-Note8-pro.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 7,
        "goodName": "大佛寺",
        "category_id": 1,
        "product_title": "大佛寺",
        "des": "大佛寺",
        "product_picture": "public/imgs/phone/Redmi-Note8.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      }
    ],
    "total": 8
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

Mock.mock(/\/cat\/goodcarouse\/carousel/, 'post', data => {
  console.log("goodcarouse 轮播图")
  Result.data = {
    code: "001",
    carousel: [{
        "carousel_id": 1,
        "imgPath": "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/plh.jpg",
        "des": "假期度假--塞外蟠龙湖"
      },
      {
        "carousel_id": 2,
        "imgPath": "https://coding-init-1254329140.cos.ap-beijing.myqcloud.com/bishu2.jpeg",
        "des": "避暑选择--避暑山庄"
      },
    ]
  }
  return Result
});

// 获取某类产品
Mock.mock('/cat/goodinfo/getProductByCategory', 'post', () => {
  Result.data = {
    "code": "001",
    "Product": [{
        "pid": 1,
        "goodName": "避暑山庄",
        "category_id": 1,
        "product_title": "皇家避暑胜地",
        "des": "皇家避暑胜地",
        "product_picture": "public/imgs/phone/Redmi-k30.png",
        "realPrice": 2000,
        "price": 1599,
        "product_num": 10,
        "product_sales": 0
      },
      {
        "pid": 3,
        "goodName": "蟠龙湖",
        "category_id": 1,
        "product_title": "蟠龙湖",
        "des": "蟠龙湖",
        "product_picture": "public/imgs/phone/Mi-CC9.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 5,
        "goodName": "外八庙",
        "category_id": 1,
        "product_title": "外八庙",
        "des": "外八庙",
        "product_picture": "public/imgs/phone/Redmi-8A.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 6,
        "goodName": "普宁寺",
        "category_id": 1,
        "product_title": "普宁寺",
        "des": "普宁寺",
        "product_picture": "public/imgs/phone/Redmi-Note8-pro.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      },
      {
        "pid": 7,
        "goodName": "大佛寺",
        "category_id": 1,
        "product_title": "大佛寺",
        "des": "大佛寺",
        "product_picture": "public/imgs/phone/Redmi-Note8.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 0
      }
    ],
    "total": 7
  }

  // Result.code = 400;
  // Result.msg = "验证码错误"
  return Result
})

// 获取热门
Mock.mock('/cat/goodinfo/getHotProduct', 'post', () => {

  Result.data = {
    code: "001",
    Product: [{
        "pid": 19,
        "goodName": "小布达拉宫一日游",
        "category_id": 5,
        "product_title": "零自费无购物小布达拉宫1日游",
        "des": "零自费无购物小布达拉宫1日游",
        "product_picture": "public/imgs/accessory/protectingShell-RedMi-K20&pro.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 10
      },
      {
        "pid": 21,
        "goodName": "木兰围场",
        "category_id": 6,
        "product_title": "木兰围场",
        "des": "木兰围场",
        "product_picture": "public/imgs/accessory/protectingMen-Mi-CC9.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 9
      },
      {
        "pid": 22,
        "goodName": "金山岭滑雪场",
        "category_id": 6,
        "product_title": "金山岭滑雪场",
        "des": "金山岭滑雪场",
        "product_picture": "public/imgs/accessory/protectingMen-Mi-CC9e.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 9
      },
      {
        "pid": 23,
        "goodName": "普陀宗乘",
        "category_id": 7,
        "product_title": "普陀宗乘",
        "des": "普陀宗乘之庙始建于乾隆三十二年（1767年），四年后建成，是“外八庙”中规模最大的一座庙宇，因仿拉萨布达拉宫而建，俗称小布达拉宫。这座寺庙内大小建筑约60处，殿堂楼宇，星罗棋布，依山面水，巧于利用地势和景物衬托，布局灵活，又不失庄严肃穆。",
        "product_picture": "public/imgs/accessory/charger-30w.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 8
      },
      {
        "pid": 24,
        "goodName": "塞罕坝国家森林公园",
        "category_id": 7,
        "product_title": "塞罕坝国家森林公园",
        "des": "塞罕坝国家森林公园",
        "product_picture": "public/imgs/accessory/charger-18w.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 8
      },
      {
        "pid": 30,
        "goodName": "　金山岭长城",
        "category_id": 8,
        "product_title": "　金山岭长城",
        "des": "　金山岭长城",
        "product_picture": "public/imgs/accessory/charger-10000mAh.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 8
      }
    ]
  }
  return Result
})


Mock.mock('/cat/goodinfo/getHotGl', 'post', () => {

  Result.data = {
    code: "001",
    Product: [{
        "pid": 19,
        "goodName": "2月最佳旅行地榜单出炉",
        "category_id": 5,
        "product_title": "小布达拉宫",
        "des": "每年12月中旬，全国大部分地区天寒地冻，而美丽的云南南涧县无量山却春意盎然。一株株粉色的冬樱花开满了山谷。这里县城51公里，海拔2175米。花期每年11月底至12月初，25天左右，樱花谷面积约2000亩。",
        "product_picture": "public/imgs/accessory/protectingShell-RedMi-K20&pro.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 10
      },
      {
        "pid": 21,
        "goodName": "穿越花海！“开往春天的列车”到了，请上车！",
        "category_id": 6,
        "product_title": "木兰围场",
        "des": "春暖花开，万物复苏近日，贵广高铁的动车在贵州省黔东南州从江县境内的油菜花田旁驶过。",
        "product_picture": "public/imgs/accessory/protectingMen-Mi-CC9.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 9
      },
      {
        "pid": 22,
        "goodName": "2022年明孝陵梅花开了，赏梅正当时~",
        "category_id": 6,
        "product_title": "金山岭滑雪场",
        "des": "2022年2月8日，明孝陵梅花山的雪还未消尽，东风已蓄满了霁青色，梅花山又传来好消息，多个品种竞相开放，梅枝疏影横斜，占尽了风情。",
        "product_picture": "public/imgs/accessory/protectingMen-Mi-CC9e.png",
        "realPrice": 2599,
        "price": 2599,
        "product_num": 20,
        "product_sales": 9
      }
    ]
  }
  return Result
})
